import Cookies from 'js-cookie'

const TokenKey = 'hrsaas-ihrm-token' // 设置一个独一无二 cookie的 key
const cookieTimeKey = 'hrsaas-ihrm-time' // cookie 的时间戳的key

export function getToken() {
  return Cookies.get(TokenKey)
}

export function setToken(token) {
  return Cookies.set(TokenKey, token)
}

export function removeToken() {
  return Cookies.remove(TokenKey)
}
// 获取 cookie里面的时间戳
export function getCookieTime() {
  return Cookies.get(cookieTimeKey)
}
// 设置 cookie里面的时间戳
export function setCookieTime() {
  Cookies.set(cookieTimeKey, Date.now())
}
